#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=13,MOD=100000000;
int n,m,stat[400],tot,can[400][400],f[13][400];
void dfs(int dep,int s)
{
	if(dep>m)
	{
		stat[++tot]=s;
		return;
	}
	if(s&1)dfs(dep+1,s<<1);
	else
	{
		dfs(dep+1,s<<1|1);
		dfs(dep+1,s<<1);
	}
	return;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	n=read();m=read();
	dfs(1,0);
	for(int i=1;i<=tot;++i)
		for(int j=1;j<=tot;++j)
			if((stat[i]&stat[j])==0)can[i][++can[i][0]]=j;
	int s=0;
	for(int j=1;j<=m;++j)s=(s<<1)+!read();
	for(int i=1;i<=tot;++i)if((stat[i]&s)==0)f[1][i]=1;
	for(int i=2;i<=n;++i)
	{
		s=0;
		for(int j=1;j<=m;++j)s=(s<<1)+!read();
		for(int j=1;j<=tot;++j)
		{
			if((stat[j]&s)!=0)continue;
			for(int k=1;k<=can[j][0];++k)
				(f[i][j]+=f[i-1][can[j][k]])%=MOD;
		}
	}
	int ans=0;
	for(int i=1;i<=tot;++i)(ans+=f[n][i])%=MOD;
	printf("%d\n",ans);
	return 0;
}
